package com.git.datasource;

/**
 * 保存本次线程的dataSourceKey
 */
public class DynamicDataHolder {
	private static final ThreadLocal<String> dataSourceThreadLocal = new ThreadLocal<>();
	
	public static void markMaster(){
		dataSourceThreadLocal.set("master");
	}
	
	public static void markSlave(){
		dataSourceThreadLocal.set("slave");
	}
	
	public static String getKey(){
		return dataSourceThreadLocal.get();
	}
}
